<%-- 
    Document   : assignRole
    Created on : Dec 20, 2009, 11:33:49 AM
    Author     : Administrator
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib  prefix="sm" uri="/WEB-INF/sm" %>
<jsp:useBean id="employee" scope="request" class="sgt.supermarket.entity.Employee"/>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Roles for ${employee.username}</title>
    </head>
    <body>
        <form method="post">
            <table border="1">
                <tr><th colspan="2">Roles for: Nguyen Duc Phuong</th></tr>
                <c:forEach var="role" items="${allRoles}" varStatus="roleCounter">
                    <tr><td>${role.name}</td><td><input type="checkbox" name="roles" value="${role.autoId}"  <c:if test="${sm:employeeHasRole(employee, role)}">checked</c:if>/></td></tr>
                        </c:forEach>
                <tr><td colspan="2"><input type="submit" value="Update roles"/></td></tr>
            </table>
        </form>
    </body>
</html>
